<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Constant Attributes (GNU Compiler Collection (GCC) Internals)</title>

<meta name="description" content="Constant Attributes (GNU Compiler Collection (GCC) Internals)">
<meta name="keywords" content="Constant Attributes (GNU Compiler Collection (GCC) Internals)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Option-Index.html" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Insn-Attributes.html" rel="up" title="Insn Attributes">
<link href="Mnemonic-Attribute.html" rel="next" title="Mnemonic Attribute">
<link href="Insn-Lengths.html" rel="prev" title="Insn Lengths">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.example {margin-left: 3.2em}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en">
<div class="subsection-level-extent" id="Constant-Attributes">
<div class="nav-panel">
<p>
Next: <a href="Mnemonic-Attribute.html" accesskey="n" rel="next">Mnemonic Attribute</a>, Previous: <a href="Insn-Lengths.html" accesskey="p" rel="prev">Computing the Length of an Insn</a>, Up: <a href="Insn-Attributes.html" accesskey="u" rel="up">Instruction Attributes</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="Constant-Attributes-1"><span>17.19.6 Constant Attributes<a class="copiable-link" href="#Constant-Attributes-1"> &para;</a></span></h4>
<a class="index-entry-id" id="index-constant-attributes"></a>

<p>A special form of <code class="code">define_attr</code>, where the expression for the
default value is a <code class="code">const</code> expression, indicates an attribute that
is constant for a given run of the compiler.  Constant attributes may be
used to specify which variety of processor is used.  For example,
</p>
<div class="example smallexample">
<pre class="example-preformatted">(define_attr &quot;cpu&quot; &quot;m88100,m88110,m88000&quot;
 (const
  (cond [(symbol_ref &quot;TARGET_88100&quot;) (const_string &quot;m88100&quot;)
         (symbol_ref &quot;TARGET_88110&quot;) (const_string &quot;m88110&quot;)]
        (const_string &quot;m88000&quot;))))

(define_attr &quot;memory&quot; &quot;fast,slow&quot;
 (const
  (if_then_else (symbol_ref &quot;TARGET_FAST_MEM&quot;)
                (const_string &quot;fast&quot;)
                (const_string &quot;slow&quot;))))
</pre></div>

<p>The routine generated for constant attributes has no parameters as it
does not depend on any particular insn.  RTL expressions used to define
the value of a constant attribute may use the <code class="code">symbol_ref</code> form,
but may not use either the <code class="code">match_operand</code> form or <code class="code">eq_attr</code>
forms involving insn attributes.
</p>
</div>



</body>
</html>
